---------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/log/Table_7_Results.log
  log type:  text
 opened on:  15 May 2024, 10:58:53

. eststo clear

. use "$rootpath/processed_data/Estimation_Data.dta", clear

. 
. sort FIRM_DUNS year

. egen mean_treat=mean(avg_old_code_prob), by(FIRM_DUNS year)

. egen mean_treat_ever=mean(avg_old_code_prob), by(FIRM_DUNS)

. gen firm_diff=avg_old_code_prob - mean_treat_ever

. egen firm_year=group(FIRM_DUNS year)
(772908 missing values generated)

. replace firm_year=0 if firm_year==.
(772,908 real changes made)

. replace mean_treat=treatXpost if no_parent_match==1
(772,908 real changes made)

. gen sub_treat=treatXpost - mean_treat*post

.  
. gen sub_treatXtreatXpost = sub_treat*treatXpost

. sort facility_id year

. //facility-level se
. reghdfe  log_damage55 sub_treatXtreatXpost treatXpost sub_treat if key_estimation_sample==1, absorb(facility_id n5#year firm_year) vce(cluster facility
> _id)
(dropped 53348 singleton observations)
(MWFE estimator converged in 262 iterations)

HDFE Linear regression                            Number of obs   =    645,665
Absorbing 3 HDFE groups                           F(   3,  75701) =      12.77
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.9486
                                                  Adj R-squared   =     0.9389
                                                  Within R-sq.    =     0.0002
Number of clusters (facility_id) =     75,702     Root MSE        =     0.3290

                               (Std. Err. adjusted for 75,702 clusters in facility_id)
--------------------------------------------------------------------------------------
                     |               Robust
        log_damage55 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------------+----------------------------------------------------------------
sub_treatXtreatXpost |  -.0459419    .235332    -0.20   0.845    -.5071916    .4153078
          treatXpost |   -.051815   .0089594    -5.78   0.000    -.0693753   -.0342547
           sub_treat |  -.0354191   .1081575    -0.33   0.743    -.2474073    .1765692
               _cons |   .7862613    .001559   504.34   0.000     .7832057    .7893169
--------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |     75702       75702           0    *|
     n5#year |      6654           1        6653     |
   firm_year |     20283           2       20281     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store ddd_1_damage

. 
. //state-level se
. reghdfe  log_damage55 sub_treatXtreatXpost treatXpost sub_treat if key_estimation_sample==1, absorb(facility_id n5#year firm_year) vce(cluster state_nu
> mber)
(dropped 53348 singleton observations)
(MWFE estimator converged in 262 iterations)

HDFE Linear regression                            Number of obs   =    645,665
Absorbing 3 HDFE groups                           F(   3,     47) =       1.27
Statistics robust to heteroskedasticity           Prob > F        =     0.2959
                                                  R-squared       =     0.9486
                                                  Adj R-squared   =     0.9389
                                                  Within R-sq.    =     0.0002
Number of clusters (state_number) =         48    Root MSE        =     0.3290

                                  (Std. Err. adjusted for 48 clusters in state_number)
--------------------------------------------------------------------------------------
                     |               Robust
        log_damage55 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------------+----------------------------------------------------------------
sub_treatXtreatXpost |  -.0459419   .2723724    -0.17   0.867    -.5938846    .5020008
          treatXpost |   -.051815   .0298979    -1.73   0.090    -.1119617    .0083318
           sub_treat |  -.0354191   .1189712    -0.30   0.767    -.2747583    .2039202
               _cons |   .7862613   .0050768   154.87   0.000     .7760481    .7964744
--------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |     75702       75702           0    *|
     n5#year |      6654           1        6653     |
   firm_year |     20283           2       20281     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store ddd_1_damageSE

. //facility-level se
. reghdfe  log_emissions4 sub_treatXtreatXpost treatXpost sub_treat if key_estimation_sample==1, absorb(facility_id n5#year firm_year) vce(cluster facili
> ty_id)
(dropped 53348 singleton observations)
(MWFE estimator converged in 258 iterations)

HDFE Linear regression                            Number of obs   =    645,665
Absorbing 3 HDFE groups                           F(   3,  75701) =      16.16
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.9507
                                                  Adj R-squared   =     0.9414
                                                  Within R-sq.    =     0.0003
Number of clusters (facility_id) =     75,702     Root MSE        =     0.2775

                               (Std. Err. adjusted for 75,702 clusters in facility_id)
--------------------------------------------------------------------------------------
                     |               Robust
      log_emissions4 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------------+----------------------------------------------------------------
sub_treatXtreatXpost |  -.1225189   .2095187    -0.58   0.559    -.5331747    .2881368
          treatXpost |  -.0504027   .0078315    -6.44   0.000    -.0657524   -.0350529
           sub_treat |   -.011114   .0963047    -0.12   0.908    -.1998708    .1776427
               _cons |   .6504187    .001365   476.49   0.000     .6477433    .6530942
--------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |     75702       75702           0    *|
     n5#year |      6654           1        6653     |
   firm_year |     20283           2       20281     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store ddd_1_emission

. 
. //state-level se
. reghdfe  log_emissions4 sub_treatXtreatXpost treatXpost sub_treat if key_estimation_sample==1, absorb(facility_id n5#year firm_year) vce(cluster state_
> number)
(dropped 53348 singleton observations)
(MWFE estimator converged in 258 iterations)

HDFE Linear regression                            Number of obs   =    645,665
Absorbing 3 HDFE groups                           F(   3,     47) =       1.33
Statistics robust to heteroskedasticity           Prob > F        =     0.2773
                                                  R-squared       =     0.9507
                                                  Adj R-squared   =     0.9414
                                                  Within R-sq.    =     0.0003
Number of clusters (state_number) =         48    Root MSE        =     0.2775

                                  (Std. Err. adjusted for 48 clusters in state_number)
--------------------------------------------------------------------------------------
                     |               Robust
      log_emissions4 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------------+----------------------------------------------------------------
sub_treatXtreatXpost |  -.1225189   .2552752    -0.48   0.633    -.6360663    .3910285
          treatXpost |  -.0504027   .0375792    -1.34   0.186    -.1260023    .0251969
           sub_treat |   -.011114   .1173379    -0.09   0.925    -.2471674    .2249394
               _cons |   .6504187   .0065012   100.05   0.000     .6373399    .6634975
--------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |     75702       75702           0    *|
     n5#year |      6654           1        6653     |
   firm_year |     20283           2       20281     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store ddd_1_emissionSE

. 
. sort FIRM_DUNS 

. egen state_vals=nvals(state_number), by(FIRM_DUNS )

. replace state_vals=1 if state_vals==.
(0 real changes made)

. replace state_vals=. if no_parent_match==1
(772,908 real changes made, 772,908 to missing)

. //replace state_vals=1 if no_parent_match==1
. 
. sort facility_id year

. //facility-level se
. reghdfe  log_damage55  treatXpost if key_estimation_sample==1&state_vals==1&no_parent_match==0, absorb(facility_id n5#year) vce(cluster facility_id)
(dropped 1121 singleton observations)
(MWFE estimator converged in 193 iterations)

HDFE Linear regression                            Number of obs   =     69,472
Absorbing 2 HDFE groups                           F(   1,   7718) =       3.97
Statistics robust to heteroskedasticity           Prob > F        =     0.0463
                                                  R-squared       =     0.9175
                                                  Adj R-squared   =     0.9021
                                                  Within R-sq.    =     0.0002
Number of clusters (facility_id) =      7,719     Root MSE        =     0.5373

                        (Std. Err. adjusted for 7,719 clusters in facility_id)
------------------------------------------------------------------------------
             |               Robust
log_damage55 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  treatXpost |  -.0917981    .046054    -1.99   0.046    -.1820764   -.0015197
       _cons |   1.851384   .0090308   205.01   0.000     1.833681    1.869087
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |      7719        7719           0    *|
     n5#year |      3217           1        3216     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store ddd_2_damage

. 
. //state-level se
. reghdfe  log_damage55  treatXpost if key_estimation_sample==1&state_vals==1&no_parent_match==0, absorb(facility_id n5#year) vce(cluster state_number)
(dropped 1121 singleton observations)
(MWFE estimator converged in 193 iterations)

HDFE Linear regression                            Number of obs   =     69,472
Absorbing 2 HDFE groups                           F(   1,     47) =       1.36
Statistics robust to heteroskedasticity           Prob > F        =     0.2500
                                                  R-squared       =     0.9175
                                                  Adj R-squared   =     0.9021
                                                  Within R-sq.    =     0.0002
Number of clusters (state_number) =         48    Root MSE        =     0.5373

                          (Std. Err. adjusted for 48 clusters in state_number)
------------------------------------------------------------------------------
             |               Robust
log_damage55 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  treatXpost |  -.0917981   .0788071    -1.16   0.250    -.2503376    .0667414
       _cons |   1.851384   .0154534   119.80   0.000     1.820296    1.882472
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |      7719        7719           0    *|
     n5#year |      3217           1        3216     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store ddd_2_damageSE

. //This is the check for “ results for plants in high treatment states 
. 
. //facility-level se
. reghdfe  log_damage55  treatXpost if key_estimation_sample==1&firm_diff>=0&no_parent_match==0, absorb(facility_id n5#year) vce(cluster facility_id)
(dropped 1046 singleton observations)
(MWFE estimator converged in 182 iterations)

HDFE Linear regression                            Number of obs   =    105,673
Absorbing 2 HDFE groups                           F(   1,  11570) =      12.23
Statistics robust to heteroskedasticity           Prob > F        =     0.0005
                                                  R-squared       =     0.9193
                                                  Adj R-squared   =     0.9059
                                                  Within R-sq.    =     0.0005
Number of clusters (facility_id) =     11,571     Root MSE        =     0.5580

                       (Std. Err. adjusted for 11,571 clusters in facility_id)
------------------------------------------------------------------------------
             |               Robust
log_damage55 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  treatXpost |  -.1376434   .0393557    -3.50   0.000    -.2147873   -.0604996
       _cons |   2.099861   .0084956   247.17   0.000     2.083208    2.116514
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |     11571       11571           0    *|
     n5#year |      3496           1        3495     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store ddd_3_damage

. 
. //state-level se
. reghdfe  log_damage55  treatXpost if key_estimation_sample==1&firm_diff>=0&no_parent_match==0, absorb(facility_id n5#year) vce(cluster state_number)
(dropped 1046 singleton observations)
(MWFE estimator converged in 182 iterations)

HDFE Linear regression                            Number of obs   =    105,673
Absorbing 2 HDFE groups                           F(   1,     47) =       4.03
Statistics robust to heteroskedasticity           Prob > F        =     0.0505
                                                  R-squared       =     0.9193
                                                  Adj R-squared   =     0.9059
                                                  Within R-sq.    =     0.0005
Number of clusters (state_number) =         48    Root MSE        =     0.5580

                          (Std. Err. adjusted for 48 clusters in state_number)
------------------------------------------------------------------------------
             |               Robust
log_damage55 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  treatXpost |  -.1376434   .0685835    -2.01   0.051    -.2756157    .0003288
       _cons |   2.099861    .014805   141.83   0.000     2.070077    2.129645
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |     11571       11571           0    *|
     n5#year |      3496           1        3495     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store ddd_3_damageSE

. ///This is the emissions based results
> 
. //facility-level se
. reghdfe  log_emissions4  treatXpost if key_estimation_sample==1&state_vals==1&no_parent_match==0, absorb(facility_id n5#year) vce(cluster facility_id)
(dropped 1121 singleton observations)
(MWFE estimator converged in 195 iterations)

HDFE Linear regression                            Number of obs   =     69,472
Absorbing 2 HDFE groups                           F(   1,   7718) =       3.76
Statistics robust to heteroskedasticity           Prob > F        =     0.0525
                                                  R-squared       =     0.9151
                                                  Adj R-squared   =     0.8992
                                                  Within R-sq.    =     0.0002
Number of clusters (facility_id) =      7,719     Root MSE        =     0.4641

                        (Std. Err. adjusted for 7,719 clusters in facility_id)
------------------------------------------------------------------------------
             |               Robust
log_emissi~4 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  treatXpost |  -.0793733   .0409372    -1.94   0.053    -.1596213    .0008748
       _cons |   1.492718   .0080275   185.95   0.000     1.476982    1.508454
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |      7719        7719           0    *|
     n5#year |      3217           1        3216     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. //This is the check for “ results for plants in high treatment states 
. 
. estimates store ddd_2_emission

. 
. //state-level se
. reghdfe  log_emissions4  treatXpost if key_estimation_sample==1&state_vals==1&no_parent_match==0, absorb(facility_id n5#year) vce(cluster state_number)
(dropped 1121 singleton observations)
(MWFE estimator converged in 195 iterations)

HDFE Linear regression                            Number of obs   =     69,472
Absorbing 2 HDFE groups                           F(   1,     47) =       1.60
Statistics robust to heteroskedasticity           Prob > F        =     0.2119
                                                  R-squared       =     0.9151
                                                  Adj R-squared   =     0.8992
                                                  Within R-sq.    =     0.0002
Number of clusters (state_number) =         48    Root MSE        =     0.4641

                          (Std. Err. adjusted for 48 clusters in state_number)
------------------------------------------------------------------------------
             |               Robust
log_emissi~4 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  treatXpost |  -.0793733   .0627136    -1.27   0.212    -.2055367    .0467902
       _cons |   1.492718   .0122976   121.38   0.000     1.467978    1.517458
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |      7719        7719           0    *|
     n5#year |      3217           1        3216     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store ddd_2_emissionSE

. //facility-level se
. reghdfe  log_emissions4  treatXpost if key_estimation_sample==1&firm_diff>=0&no_parent_match==0, absorb(facility_id n5#year) vce(cluster facility_id)
(dropped 1046 singleton observations)
(MWFE estimator converged in 180 iterations)

HDFE Linear regression                            Number of obs   =    105,673
Absorbing 2 HDFE groups                           F(   1,  11570) =      12.64
Statistics robust to heteroskedasticity           Prob > F        =     0.0004
                                                  R-squared       =     0.9206
                                                  Adj R-squared   =     0.9074
                                                  Within R-sq.    =     0.0005
Number of clusters (facility_id) =     11,571     Root MSE        =     0.4801

                       (Std. Err. adjusted for 11,571 clusters in facility_id)
------------------------------------------------------------------------------
             |               Robust
log_emissi~4 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  treatXpost |  -.1236252   .0347778    -3.55   0.000    -.1917956   -.0554548
       _cons |   1.725205   .0075074   229.80   0.000     1.710489    1.739921
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |     11571       11571           0    *|
     n5#year |      3496           1        3495     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store ddd_3_emission

. 
. //state-level se
. reghdfe  log_emissions4  treatXpost if key_estimation_sample==1&firm_diff>=0&no_parent_match==0, absorb(facility_id n5#year) vce(cluster state_number)
(dropped 1046 singleton observations)
(MWFE estimator converged in 180 iterations)

HDFE Linear regression                            Number of obs   =    105,673
Absorbing 2 HDFE groups                           F(   1,     47) =       5.03
Statistics robust to heteroskedasticity           Prob > F        =     0.0297
                                                  R-squared       =     0.9206
                                                  Adj R-squared   =     0.9074
                                                  Within R-sq.    =     0.0005
Number of clusters (state_number) =         48    Root MSE        =     0.4801

                          (Std. Err. adjusted for 48 clusters in state_number)
------------------------------------------------------------------------------
             |               Robust
log_emissi~4 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  treatXpost |  -.1236252   .0551486    -2.24   0.030    -.2345699   -.0126805
       _cons |   1.725205   .0119048   144.92   0.000     1.701256    1.749154
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
 facility_id |     11571       11571           0    *|
     n5#year |      3496           1        3495     |
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store ddd_3_emissionSE

. esttab ddd_1_damage ddd_2_damage ddd_3_damage ddd_1_emission ddd_2_emission ddd_3_emission using "$rootpath/table_graph/DDD_TBL7.tex",  star( * 0.1 ** 
> 0.05 *** 0.01) cells(b(star fmt(3)) se(par fmt(3))) keep(sub_treatXtreatXpost treatXpost sub_treat _cons) scalars(N F) ar2 replace 
(note: file /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/table_graph/DDD_TBL7.tex not found)
(output written to /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/table_graph/DDD_TBL7.tex)

. esttab ddd_1_damageSE ddd_2_damageSE ddd_3_damageSE ddd_1_emissionSE ddd_2_emissionSE ddd_3_emissionSE using "$rootpath/table_graph/DDD_TBL7SE.tex",  s
> tar( * 0.1 ** 0.05 *** 0.01) cells(b(star fmt(3)) se(par fmt(3))) keep(sub_treatXtreatXpost treatXpost sub_treat _cons) scalars(N F) ar2 replace 
(note: file /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/table_graph/DDD_TBL7SE.tex not found)
(output written to /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/table_graph/DDD_TBL7SE.tex)

. log close
      name:  <unnamed>
       log:  /Users/wesleyblundell/Dropbox/Wes_Supplemental_NEI/JAERE_Replication/Replication_package/log/Table_7_Results.log
  log type:  text
 closed on:  15 May 2024, 11:03:04
---------------------------------------------------------------------------------------------------------------------------------------------------------
